We use can/could to describe ability, and we use can’t/couldn’t to describe absence of ability.
We also use can to talk about possibility.
We use can/could to talk about something that is or was allowed and we use can’t/couldn’t to talk about something that is not allowed.
We also use can to ask for permission.
We us can/could in requests, i.e. when we ask somebody to do something.
Verbs of perception (see, smell, hear, etc.) are stative verbs and cannot be used in a continuous form. Instead, we use can.
Be able to is often similar to can and we may use it instead of can to talk about ability. But be able to is more formal and is not as common.
But can only has present and past forms: can–could. For all other verb forms (infinitive, gerund, present perfect, etc.) we should use be able to.
We can use can and be able to to talk about general ability in the present.
We can use could and be able to to talk about general ability in the past.
But if we want to say that someone did something in a specific situation, we must use was/were able to, or managed to + infinitive.
In negative sentences, both could and be able to can be used to say that we were not capable of doing something on a specific occasion.